<template>
    <div style="background-color:lightgreen;">
        <h2>左侧商品导航组件</h2>
        <ul>
            <li v-for="item in nav" :key="item.id">
                <a href="" @click.prevent="ClickHandle(item.id)">{{ item.name }}</a>
            </li>
        </ul>
    </div>
</template>


<script>
export default {
    data() {
        return {
            nav:[
                {id:'1',name:'我超冰'},
                {id:'2',name:'蛋糕'},
                {id:'3',name:'巧克力'},
            ],
        }
    },
    methods: {
        ClickHandle(cid){
            this.$emit('handle',cid)
        },
    },

}
</script>